Skip to content

Comments

Use ArrayExpansion for fixed buffer fields#81536

Merged
AlekseyTs merged 8 commits intodotnet:mainfrom
asundheimMSFT:main
Dec 22, 2025
Merged

Use ArrayExpansion for fixed buffer fields#81536
AlekseyTs merged 8 commits intodotnet:mainfrom
asundheimMSFT:main

Conversation

@asundheimMSFT
Copy link
Contributor

Overview

Fixed buffer fields look like structs with a single member in metadata, so we would use MemberExpansion which only shows the first element. Instead we should use ArrayExpansion, in a similar fashion to what we did for [InlineArray] in #81254.

Details

  • Added additional helper to InlineArrayHelpers that identifies generated fixed buffer types
  • Fixed up test mocks to handle some novel usage of certain LMR Type properties.

Testing

Added test that validates that we get an ArrayExpansion for a fixed buffer. Comment in the test describes why we cannot use the typical testing approach that we use for other ArrayExpansion tests.
image

@dotnet-policy-service dotnet-policy-service bot added the Community The pull request was submitted by a contributor who is not a Microsoft employee. label Dec 3, 2025
@asundheimMSFT
Copy link
Contributor Author

cc @tmat @333fred @AaronRobinsonMSFT

Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me.

Copy link
Member

@tmat tmat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Compiler team should review.

@333fred
Copy link
Member

333fred commented Dec 10, 2025

@dotnet/roslyn-compiler for a second review

@AlekseyTs
Copy link
Contributor

AlekseyTs commented Dec 11, 2025

Done with review pass (commit 4) #Closed

@asundheimMSFT asundheimMSFT requested a review from a team as a code owner December 12, 2025 22:09
@asundheimMSFT
Copy link
Contributor Author

@AlekseyTs ready for re-review

Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (commit 6)

@AlekseyTs AlekseyTs requested review from 333fred and tmat December 15, 2025 23:19
@AlekseyTs AlekseyTs enabled auto-merge (squash) December 22, 2025 16:08
@AlekseyTs AlekseyTs merged commit b600fe8 into dotnet:main Dec 22, 2025
28 of 29 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Dec 22, 2025
@AlekseyTs
Copy link
Contributor

@asundheimMSFT Thank you for the contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Compilers Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants